<extend name="Public/base"/>

<block name="body">

    <include file="Public/edit" />

</block>

<block name="script">
    <include file="Public/footjs" />

    <script type="text/javascript">
        /**
         * @author Tealun Du
         */
        $(function(){

            $(".main-title>h2").text("编辑事件：{$data.event_name}");
            /*触发类型更改时指令项显示信息更改*/
            function actionType(flow_id,clear){
                var replyData = {$replyData};
                var textArea = $("textarea[name=action_data]");
                if (flow_id >0 && replyData[flow_id].need == true){
                    textArea.parents("div.controls").siblings("label").html(
                            replyData[flow_id].tip + '：<span class="check-tips">'+replyData[flow_id].holder+'</span>'
                    );
                    if(clear == true){
                        textArea.empty();
                    }
                    textArea.show();

                }else if(flow_id >0 && replyData[flow_id].need == false){
                    textArea.empty();
                    textArea.hide();
                    textArea.parents("div.controls").siblings("label").html(
                            replyData[flow_id].title + '：<span class="check-tips">本项无需填写数据</span>'
                    );
                };

            };

            actionType($("select[name=flow_id]").val(),false); //根据已选触发类型显示相应选项

            $("select[name=flow_id]").change(function(){
                actionType($(this).val(),true);
            });
        });
    </script>

</block>
